package com.example.twoscroolview.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.twoscroolview.R
import com.example.twoscroolview.adapter.StringAdapter
import kotlinx.android.synthetic.main.fragment1.*

class Fragment1:Fragment() {
    val list2 = mutableListOf<String>()
    private val adapter2 by lazy {
        StringAdapter()
    }
    var contentView:View?=null
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        contentView = inflater.inflate(R.layout.fragment1,container,false)
        return contentView
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        for (i in 0..50){
            list2.add("TwoScrollViewActivity------"+i)
        }

        super.onViewCreated(view, savedInstanceState)

        recycleView2.adapter = adapter2
        recycleView2.layoutManager= LinearLayoutManager(activity)
        adapter2.replaceData(list2)
    }
}